# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ServiceConsumerManagement.V1.Model.TenantProjectConfig do
  @moduledoc """
  This structure defines a tenant project to be added to the specified tenancy unit and its initial configuration and properties. A project lien is created for the tenant project to prevent the tenant project from being deleted accidentally. The lien is deleted as part of tenant project removal.

  ## Attributes

  *   `billingConfig` (*type:* `GoogleApi.ServiceConsumerManagement.V1.Model.BillingConfig.t`, *default:* `nil`) - Billing account properties. The billing account must be specified.
  *   `folder` (*type:* `String.t`, *default:* `nil`) - Folder where project in this tenancy unit must be located This folder must have been previously created with the required permissions for the caller to create and configure a project in it. Valid folder resource names have the format `folders/{folder_number}` (for example, `folders/123456`).
  *   `labels` (*type:* `map()`, *default:* `nil`) - Labels that are applied to this project.
  *   `serviceAccountConfig` (*type:* `GoogleApi.ServiceConsumerManagement.V1.Model.ServiceAccountConfig.t`, *default:* `nil`) - Configuration for the IAM service account on the tenant project.
  *   `services` (*type:* `list(String.t)`, *default:* `nil`) - Google Cloud API names of services that are activated on this project during provisioning. If any of these services can't be activated, the request fails. For example: 'compute.googleapis.com','cloudfunctions.googleapis.com'
  *   `tenantProjectPolicy` (*type:* `GoogleApi.ServiceConsumerManagement.V1.Model.TenantProjectPolicy.t`, *default:* `nil`) - Describes ownership and policies for the new tenant project.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :billingConfig => GoogleApi.ServiceConsumerManagement.V1.Model.BillingConfig.t() | nil,
          :folder => String.t() | nil,
          :labels => map() | nil,
          :serviceAccountConfig =>
            GoogleApi.ServiceConsumerManagement.V1.Model.ServiceAccountConfig.t() | nil,
          :services => list(String.t()) | nil,
          :tenantProjectPolicy =>
            GoogleApi.ServiceConsumerManagement.V1.Model.TenantProjectPolicy.t() | nil
        }

  field(:billingConfig, as: GoogleApi.ServiceConsumerManagement.V1.Model.BillingConfig)
  field(:folder)
  field(:labels, type: :map)

  field(:serviceAccountConfig,
    as: GoogleApi.ServiceConsumerManagement.V1.Model.ServiceAccountConfig
  )

  field(:services, type: :list)

  field(:tenantProjectPolicy, as: GoogleApi.ServiceConsumerManagement.V1.Model.TenantProjectPolicy)
end

defimpl Poison.Decoder, for: GoogleApi.ServiceConsumerManagement.V1.Model.TenantProjectConfig do
  def decode(value, options) do
    GoogleApi.ServiceConsumerManagement.V1.Model.TenantProjectConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ServiceConsumerManagement.V1.Model.TenantProjectConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
